<?php $header=$this->action('ZfcAdmin\Controller\AdminController', 'headerAction');
	  $baseUrl = $header->headerarray['baseUrl'];
?>
<?php if(isset($_SESSION['admin'])){?>
<html>
	<center>
		<head>
			<?php if(isset($_GET['category_id']) && $_GET['category_id']!=""){?>
			<h1>Edit Category</h1>
			<?}else{?>
			<h1>Add Category</h1>
			<?}?>
		</head><br/>
		<body>
			<form id="add_cat_form" name="add_cat_form" method="post" action="">
				Category Name: <input type="text" name="cat_name" value="<? if(isset($this->cat_details->category_name) && $this->cat_details->category_name!=""){echo $this->cat_details->category_name;}else{}?>" id="cat_name" placeholder="Please enter category name"><br/><br/>
				<a href="<? echo $baseUrl.'admin/category'?>">Back</a>&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" id="btn_cat" name="btn_cat" value="Submit" onClick="return add_cat();">
				<input type="hidden" id="hid_cat" name="hid_cat" value="<? if(isset($this->cat_details->category_id) && $this->cat_details->category_id!=""){echo $this->cat_details->category_id;}else{}?>">
			</form>
		</body>
	</center>
</html>
<? } else {?>
<script>
	window.location=ADMIN_BASE_URL+'admin';
</script>
<?}?>

